package com.one.service.impl;

import com.one.mapper.CleanRcordMapper;
import com.one.pojo.CleanRecord;
import com.one.service.CleanRcordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description
 * @Author semstouch
 * @Date 2017/4/11
 **/
@Service
public class CleanRcordServiceImpl implements CleanRcordService{
    @Resource
    private CleanRcordMapper cleanRcordMapper;

    @Override
    public int countNum(String cleanId) {
        return cleanRcordMapper.countNum(cleanId);
    }

    @Override
    public CleanRecord selectByCleanId(String cleanId, String daily, String friendId) {
        return cleanRcordMapper.selectByCleanId(cleanId,  daily,  friendId);
    }

    @Override
    public List<CleanRecord> findByCleanId(String cleanId,int numPerPage, int currentPage) {
        int start = 0;
        start = (currentPage - 1) * numPerPage;
        return cleanRcordMapper.findByCleanId(cleanId,start,numPerPage);
    }
}
